app.controller('renyuanxuanze',['$scope','$http','mainService','$location',function ($scope,$http,mainService,$location) {
    var token = localStorage.getItem('token');


    var loujianshenpiren ;
    if(mainService.getLjsq().sid){
        $scope.orpSid = mainService.getLjsq()[0].orgDepartmentId;
        loujianshenpiren = "/om/om-staff!findApproveBy.action";
    }else {
        $scope.sid = '';
        loujianshenpiren = '/om/om-staff!findMutiByPage.action';
    }
    $http({
        method: "POST",
        url: mainUrl+loujianshenpiren,
        params: {
            'Authorization': token,
            'qm.staffState':1,
            'orpSid':Number($scope.orpSid),
            'page':1,
            'start':0,
            'limit':15,


        }
    }).then(
        function(data, status, headers, config){
            $scope.item=data.data.items;
            console.log(data);
        },function(data, status, headers, config){

        }
    );
    $scope.sending = function ($event) {
        switch (mainService.getFzrtz()){
            case 10:
                mainService.setyhxqFzr($event);
                $location.path('/wzgyhxq');
                break;
            case 20:
                mainService.setFzr($event);
                $location.path('/bhgzgxq');
                break;
            case 101:
            mainService.setFzr($event);
            $location.path('/wzdjhyhxq');
                break;
            case 102:
                mainService.setFzr($event);
                console.log(mainService.getFzr());
                $location.path('/wzgyhxq');
                break;
            case 103:
                mainService.setFzr($event);
                $location.path('/daiyanshouyinhuan');
                break;
            case 104:
                mainService.setyhxqFzr($event);
                $location.path('/bhgzgxq');
                break;
            case 105:
                mainService.setFzr($event);
                $location.path('/wzdjhyhxq');
                break;
            case 106:
                mainService.setFzr($event);
                $location.path('/loujianshenqingPage');

        }
        console.log($event)
    }
}]);